<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<title>联系我们</title>
<link href="/myhouse/static/web/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/myhouse/static/web/js/jquery.min.js"></script>
<!-- Custom Theme files -->
<!--menu-->
<script src="/myhouse/static/web/js/scripts.js"></script>
<link href="/myhouse/static/web/css/styles.css" rel="stylesheet">
<!--//menu-->
<!--theme-style-->
<link href="/myhouse/static/web/css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Real Home Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
</head>
<body>
<script src="/myhouse/static/web/js/easyResponsiveTabs.js" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function () {
		$('#horizontalTab').easyResponsiveTabs({
			type: 'default', //Types: default, vertical, accordion
			width: 'auto', //auto or any width like 600px
			fit: true   // 100% fit in a container
		});
	});
</script>
<!--header-->
<jsp:include page="/inc/head.jsp"></jsp:include>
<!--//-->
<script src="/myhouse/static/web/js/easyResponsiveTabs.js" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function () {
		$('#horizontalTab').easyResponsiveTabs({
			type: 'default', //Types: default, vertical, accordion
			width: 'auto', //auto or any width like 600px
			fit: true   // 100% fit in a container
		});
	});
</script>
<div class=" banner-buying">
	<div class=" container">
	<h3><span>MY</span>HOUSE</h3>
	<!---->
<jsp:include page="/inc/menu.jsp"></jsp:include>
	<div class="clearfix"> </div>
		<!--initiate accordion-->
		<script type="text/javascript">
			$(function() {
			    var menu_ul = $('.menu > li > ul'),
			           menu_a  = $('.menu > li > a');
			    menu_ul.hide();
			    menu_a.click(function(e) {
			        e.preventDefault();
			        if(!$(this).hasClass('active')) {
			            menu_a.removeClass('active');
			            menu_ul.filter(':visible').slideUp('normal');
			            $(this).addClass('active').next().stop(true,true).slideDown('normal');
			        } else {
			            $(this).removeClass('active');
			            $(this).next().stop(true,true).slideUp('normal');
			        }
			    });
			});
		</script>
      		
	</div>
</div>
<!--//header-->
<!--contact-->
<div class="contact">
	<div class="container">
		<h3>联系我们</h3>
	 <div class="contact-top">
		 <c:if test="${empty sessionScope.user}">
			 <div style="margin-left: 400px">
				 <span  style="font-size: 50px">请先登录</span>
				 <br><br><br><br><br>·
				 <span style="font-size: 20px"> 是否拥有 My House? </span>
				 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="hvr-sweep-to-right" href="/myhouse/web/login">登录</a>
			 </div>
		 </c:if>
		 <c:if test="${not empty sessionScope.user}">
		<div class="col-md-6 contact-top1">
		  <h4 >信息</h4>
          <p class="text-contact">欢迎您与我们联系。无论您是有房产买卖、租赁的需求，还是对房产市场有任何疑问，我们都期待着您的到来。
			  我们拥有专业的团队，团队成员具备丰富的房产知识和经验。无论是从房屋的建筑结构、户型设计，还是房产交易流程、法律法规等方面，都能为您提供全方位的服务。</p>
		  <div class="contact-address">
			  <div class="col-md-6 contact-address1">
				  <h5>中介姓名</h5>
				  <p>${requestScope.house.mediator.mediatorName}</p>
			  </div>
		  	<div class="col-md-6 contact-address1">
			  	  <h5>邮箱</h5>
	             <p>${requestScope.house.mediator.email}</p>
		  	</div>
		  	<div class="clearfix"></div>
		  </div>
		  <div class="contact-address">
		  	<div class="col-md-6 contact-address1">
			  	 <h5>联系电话</h5>
	             <p>${requestScope.house.mediator.mediatorPhone}</p>
	        </div>
			  <div class="col-md-6 contact-address1">
				  <h5>地址</h5>
				  <p>${requestScope.house.mediator.officeAddress}</p>
			  </div>
		  	<div class="clearfix"></div>
		  </div>
		</div>
		<div class="col-md-6 contact-right">
            <form action="/myhouse/web/updatecontact" method="post" id="myform">
				<input type="hidden" value="${sessionScope.user.id}" name="userId">
				<input type="hidden" value="${requestScope.house.mediator.id}" name="mediatorId">
               <input type="text"  placeholder="姓名" value="${sessionScope.user.userName}" disabled required="" name="userName" id="myuserId"><span id="isRemyuserId"></span><br>
			   <input type="text" placeholder="邮箱" value="${sessionScope.user.userEmail}" disabled required="" name="userEmail" id="myuserEmail"><span id="isRemyuserEmail"></span><br>
			   <input type="text" placeholder="手机号" value="${sessionScope.user.userPhone}" disabled required="" name="userPhone" id="myuserPhone"><span id="isRemyuserPhone"></span><br>
			   <textarea  placeholder="信息" requried="" name="content" id="mycontent"></textarea><span id="isRemycontent"></span><br>
			   <div class="   right-side">
				   <input type="submit" id="mysubmit" class="hvr-sweep-to-right more" value="提交">
<%--				   <a href="hotel_selection.jsp" class="hvr-sweep-to-right more"  >提交</a>--%>
			   </div>
			</form>
			</c:if>
		</div>
		<div class="clearfix"> </div>
</div>
	</div>
	<%--表单验证--%>
	<script type="text/javascript" src="/static/web/js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript">
	$(function (){
		$("input[type='submit']").click(checkContact);//点提交时校验
	});
	function checkContact (){//验证是否填入用户信息
		var ckusername = $("#myuserId").val();
		var ckuseremail = $("#myuserEmail").val();
		var ckuserphone = $("#myuserPhone").val();
		var ckcontent = $("#mycontent").val();

		var ckusernameFlag;
		var ckuseremailFlag
		var ckuserphoneFlag;
		var ckcontentFlag;

		if(ckusername!=""){
			ckusernameFlag = true;
		}
		else{
			ckusernameFlag = false;
			$("#isRemyuserId").html("请完善信息！");
			$("#isRemyuserId").css("color","red");
		}

		if(ckuseremail!=""){
			ckuseremailFlag = true;
		}
		else {
			ckuseremailFlag = false;
			$("#isRemyuserEmail").html("请完善信息！");
			$("#isRemyuserEmail").css("color","red");
		}

		if(ckuserphone!=""){
			ckuserphoneFlag = true;
		}
		else {
			ckuserphoneFlag = false;
			$("#isRemyuserPhone").html("请完善信息！");
			$("#isRemyuserPhone").css("color","red");
		}

		if(ckcontent!=""){
			ckcontentFlag = true;
		}
		else{
			ckcontentFlag = false;
			$("#isRemycontent").html("请填写信息！");
			$("#isRemycontent").css("color","red");
		}

		return ckusernameFlag && ckuseremailFlag && ckuserphoneFlag && ckcontentFlag;
	}
	</script>
	<%--表单验证--%>

<%--	<div class="map">--%>
<%--	     <iframe src="https://www.amap.com/" sandbox=""> </iframe>--%>
<%--	    </div>--%>
</div>

<!--//contact-->
<!--footer-->
<jsp:include page="/inc/footer.jsp"></jsp:include>
<!--//footer-->
</body>

</html>